import { Form, Row, FormItem, Input, Select } from 'ant-design-vue';

export function useFilterForm(layOutOption, labelOption) {
  const { layout = 'inline', grid = {} } = layOutOption;

  return (
    <Form layout={layout} v-bind={grid}>
      {labelOption.map((item, index) => {
        return (
          <FormItem label={item.name} key={index}>
            {!item.selectOptions ? (
              <Input value={item.value} placeholder="请输入" />
            ) : (
              <Select value={item.value} options={item.selectOptions} placeholder="请选择" />
            )}
          </FormItem>
        );
      })}
    </Form>
  );
}
